<template>
    <h2>子组件</h2>
    <h3>{{ s }}</h3>
    <button @click="add">点击增加</button>

</template>

<script setup lang='ts'>
import {onActivated, onDeactivated, ref} from "vue";
let s=ref(666);
let add=()=>{
    s.value++;
}

onActivated(()=>{
    console.log("子组件被激活！");
})

onDeactivated(()=>{
    console.log("子组件被停用！");
})



</script>

<style scoped>

</style>
